import { Controller, Get, Post, Body, Patch, Param, Delete, UseGuards } from '@nestjs/common';
import { FormConfigService } from './form-config.service';
import { CreateFormConfigDto } from './dto/create-form-config.dto';
import { JwtAuthGuard } from '../auth/jwt-auth.guard';

@Controller('form-config')
@UseGuards(JwtAuthGuard)
export class FormConfigController {
  constructor(private readonly formConfigService: FormConfigService) {}

  @Post()
  create(@Body() createFormConfigDto: CreateFormConfigDto) {
    return this.formConfigService.create(createFormConfigDto);
  }

  @Get()
  findAll() {
    return this.formConfigService.findAll();
  }

  @Get(':id')
  findOne(@Param('id') id: string) {
    return this.formConfigService.findOne(+id);
  }

  @Patch(':id')
  update(@Param('id') id: string, @Body() updateFormConfigDto: Partial<CreateFormConfigDto>) {
    return this.formConfigService.update(+id, updateFormConfigDto);
  }

  @Delete(':id')
  remove(@Param('id') id: string) {
    return this.formConfigService.remove(+id);
  }
}